﻿using System.IO;
using UnityEditor;
using UnityEngine;
using System.Collections;

public class ChangeName : MonoBehaviour {

	[MenuItem("Coser/Tools/ChangeName")]
	public static void SplitName()
	{
		var assets = Selection.objects;
		foreach (var asset in assets)
		{
			var a = AssetDatabase.GetAssetPath(asset);
			Debug.Log(a);
			var b = Path.GetDirectoryName(a) +"/"+ Path.GetFileName(a).Substring(3);
			var c = Path.GetFileNameWithoutExtension(a).Substring(3);
			Debug.Log(b);
			Debug.Log(AssetDatabase.RenameAsset(a, c)); 
			AssetDatabase.SaveAssets();
		}
	}
}
